import requests
import json

# 目标电话号码
target_phone = "15937098754"

# 调用测试端点
def test_phone_search():
    url = f"http://localhost:8002/test-phone-search?phone={target_phone}"
    response = requests.get(url)
    if response.status_code == 200:
        results = response.json()
        print(f"检索结果: {json.dumps(results, ensure_ascii=False, indent=2)}")
        # 检查是否找到结果
        if results["results_count"] > 0:
            print(f"成功找到{results['results_count']}条包含电话号码{target_phone}的记录")
        else:
            print(f"未找到包含电话号码{target_phone}的记录")
    else:
        print(f"调用测试端点失败: {response.status_code} - {response.text}")

if __name__ == "__main__":
    # 调用测试端点
    test_phone_search()